package com.tencreat.domain.mall.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tencreat.common.core.domain.BaseEntity;
import com.tencreat.common.enums.OrderStatus;
import com.tencreat.common.enums.PayType;
import com.tencreat.common.enums.ShopOrderStatus;
import com.tencreat.common.enums.UserOrderStatus;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;


/**
 * 订单对象 mall_order
 *
 * @author tencreat
 * @date 2021-08-19
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
@ExcelIgnoreUnannotated
public class MallOrderVO5 extends BaseEntity<MallOrderVO5> {
    private static final long serialVersionUID = 1L;

    /**
     * $column.columnComment
     */
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "ID")
    private Long id;

    @ApiModelProperty(value = "优惠券ID")
    @TableField("`coupon_id`")
    private Long couponId;

    /**
     * 订单编号
     */
    @ExcelProperty(value = "订单编号",order = 1)
    @ApiModelProperty(value = "订单编号")
    private String orderSn;

    @ExcelProperty(value = "用户ID",order = 2)
    @ColumnWidth(9)
    @ApiModelProperty(value = "用户表的用户UUID")
    private Long uuid;

    @TableField(exist = false)
    @ExcelProperty(value = "手机号码",order = 3)
    private String userPhone;

    @ExcelProperty(value = "商品ID",order = 4)
    @ColumnWidth(9)
    private Long goodsId;

    @TableField(exist = false)
    @ExcelProperty(value = "商品名称",order = 5)
    private String goodsName;

   
    @TableField(exist = false)
    private String picUrl;

    @ApiModelProperty("规格名称")
    private String attribute;


    @ApiModelProperty("供应商名称")
    @TableField(exist = false)
    private String username;

    @ApiModelProperty(value = "订单类型")
    private String orderTypeDesc;

    @ExcelProperty(value = "数量",order = 7)
    @TableField(exist = false)
    private Integer goodsNum;

    @ApiModelProperty(value = "订单费用， = goods_price")
    private BigDecimal orderPrice;

    @ApiModelProperty("服务站名称")
    @TableField(exist = false)
    private String StoreName;


    @ApiModelProperty(value = "收货人名称")
    private String consignee;

    @ApiModelProperty(value = "收货人手机号")
    private String mobile;

    @ApiModelProperty(value = "收货具体地址")
    private String address;

    @ApiModelProperty(value = "用户订单留言")
    private String message;

    @ExcelProperty(value = "付款方式",order = 9)
    @ApiModelProperty(value = "支付方式")
    private String payTypeDesc;

    @ExcelProperty(value = "订单状态",order = 10)
    @ApiModelProperty(value = "订单状态")
    private String orderStatusDesc;

    @ApiModelProperty("自提时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime selfMentionTime;

    @ApiModelProperty("创建时间")
    @ExcelProperty(value = "下单时间",order = 11)
    @ColumnWidth(16)
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime2;

    @ApiModelProperty(value = "用户状态")
    @TableField("`status_user`")
    private UserOrderStatus statusUser;

    @ApiModelProperty(value = "商家状态")
    private ShopOrderStatus statusShop;


    @ApiModelProperty(value = "订单状态")
    private OrderStatus orderStatus;


    /**
     * 售后状态，0是可申请，1是用户已申请，2是管理员审核通过，3是管理员退款成功，4是管理员审核拒绝，5是用户已取消
     */
    @ApiModelProperty(value = "售后状态，0是可申请，1是用户已申请，2是管理员审核通过，3是管理员退款成功，4是管理员审核拒绝，5是用户已取消")
    private Integer aftersaleStatus;

    @ApiModelProperty(value = "收货地址Id")
    private Long addressId;

    @ApiModelProperty(value = "商品总费用")
    private BigDecimal goodsPrice;

    @ApiModelProperty(value = "配送费用")
    private BigDecimal freightPrice;

    @ApiModelProperty(value = "优惠券减免")
    private BigDecimal couponPrice;

    @ApiModelProperty(value = "会员减免")
    private BigDecimal memberPrice;

    @ApiModelProperty(value = "用户积分减免")
    private BigDecimal integralPrice;

    @ApiModelProperty(value = "积分抵扣金额")
    private BigDecimal deductPrice;

    @ApiModelProperty("使用积分类型 1现金积分 2购物积分")
    private Integer integralType;

    @ApiModelProperty(value = "团购优惠价减免")
    private BigDecimal grouponPrice;

    @ExcelProperty(value = "订单金额",order = 8)
    @ApiModelProperty(value = "实付费用， = goods_price - coupon_price + freight_price")
    private BigDecimal actualPrice;

    @ApiModelProperty(value = "支付方式")
    private PayType payType;

    @ApiModelProperty(value = "付款编号")
    private String payId;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    private Date payTime;

    @ApiModelProperty(value = "发货编号")
    private String shipSn;

    @ApiModelProperty(value = "发货快递公司")
    private String shipChannel;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    private Date shipTime;


    /**
     * 实际退款金额，（有可能退款金额小于实际支付金额）
     */
    private BigDecimal refundAmount;

    @ApiModelProperty(value = "退款方式")
    private String refundType;

    @ApiModelProperty(value = "退款备注")
    private String refundContent;


    /**
     * 退款时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    private Date refundTime;


    /**
     * 用户确认收货时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    private Date confirmTime;


    /**
     * 待评价订单商品数量
     */
    @ApiModelProperty(value = "待评价订单商品数量")
    private Integer comments;


    /**
     * 订单关闭时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endTime;


    @ApiModelProperty(value = "用户端是否删除（0否 1是）")
    private Boolean appDel;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @TableLogic
    private String delFlag;

    /**
     * 租户ID
     */
    @ApiModelProperty(value = "租户ID")
    private Long tenantId;

    /**
     * 自提ID
     */
    @ApiModelProperty(value = "自提ID")
    private Long selfmentionId;

    @TableField(exist = false)
    private String beginTime;

    @TableField(exist = false)
    private String endTimes;

    @TableField(exist = false)
    private BigDecimal supplyPrice;

    @TableField(exist = false)
    private Long orderGoodsId;
    /****
     * 订单类型   1 订单自提 2 订单发货（暂不用） 3 会员订单(暂不使用)  4 虚拟订单
     *
     */
    @TableField(exist = false)
    private Long orderMold;
    /****
     * 是否取件
     */

    @TableField(exist = false)
    private Long take;

    @TableField(exist = false)
    private Long selfId;
    @TableField(exist = false)
    private Long normsId;

    @ApiModelProperty("上传商品的用户ID")
    @TableField(exist = false)
    private Long userId;

    @ApiModelProperty("自提时间-开始时间")
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startTime;

    @ApiModelProperty("自提时间-结束时间")
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endTime2;


    @TableField(exist = false)
    private  Integer orderTypeValue;
}
